import React, { Component } from 'react';
import autoBind from 'react-autobind';
import { Tabs } from 'antd-mobile';

// style
import styles from './index.css';
import IconfontStyle from '../../../assets/iconfont/iconfont.css';
import BuyCarBodyItem from './BuyCarBodyItem';
import BuyCarBodyEmpty from './BuyCarBodyEmpty';

class BuyCarBody extends Component {
	constructor(props) {
        super(props)
        autoBind(this)
    }
    
	render() {
		const { buycar, checkAll, mergeStore } = this.props
	 	return (
	 		<div className={styles["buy-car-body"]}>
	 			{
	 				buycar.cartList && buycar.cartList.length ? buycar.cartList.map((store, key) => {
	 					return <BuyCarBodyItem 
	 								checkAll={checkAll}
	 								mergeStore={mergeStore}
		 							store={store} 
		 							key={key} 
		 							{...this.props}
		 						/>
		 				}) : (<BuyCarBodyEmpty {...this.props} />)
	 			}
	 		</div>
	  	);
	}
};

BuyCarBody.propTypes = {
};

export default BuyCarBody
